﻿using System.Collections;
using System.Configuration;
using System.Data;
using System;

public class MenuTrai
{
	public MenuTrai()
	{
	}

    public static ArrayList MenuParent()
    {
        Data data = new Data();
        try
        {
            ArrayList MenuParent = new ArrayList();
            DataTable table = data.GetTable_By_Where("MucLucPhapLuat", " order by MucPhapLuatID ASC");
            for (int i = 0; i < table.Rows.Count; i++)
            {
                MenuParent.Add(table.Rows[i]["MucPhapLuatID"].ToString() + ";" + table.Rows[i]["MucPhapLuatName"].ToString() + ";" + table.Rows[i]["MucPhapLuatDescription"].ToString());
            }
            return MenuParent;
        }
        finally { }
    }
    public static ArrayList MenuChild(string _tableName)
    {
        Data data = new Data();
        try
        {
            ArrayList MenuChilds = new ArrayList();
            DataTable tableChild = data.GetTable_By_Name(_tableName);
            for (int i = 0; i < tableChild.Rows.Count; i++)
            {
                MenuChilds.Add(tableChild.Rows[i][_tableName + "ID"].ToString() + ";" + tableChild.Rows[i][_tableName + "Description"].ToString() + ";" + tableChild.Rows[i][_tableName +"Name"].ToString());
            }
            return MenuChilds;
        }
        finally {  }
    }
}
